Enable new PSScriptAnalyzer option removeTrailingWhitespace#5280
Enable new PSScriptAnalyzer option removeTrailingWhitespace#5280liamjpeters wants to merge 2 commits intoPowerShell:mainfrom
removeTrailingWhitespace#5280Conversation
|
Hm, with VS Code's built-in remove-trailing-whitespace functionality I could this actually being confusing were a user to disable that, but still have this on (I know it defaults to false, I'm just pointing out that it means exposing two settings for two features which do the same thing, and I personally think I'd opt to set this rule off permanently in VS Code usage of PSSA). |
|
I can see that side of it - hadn't thought about it being confusing. I'm probably in the minority - I don't like formatting on save, which is what the other setting does 😅. If that's the consensus then I'm fine to close this. I can investigate trying to make VSCode do it when I Shift+Alt+F. It's a simple PR but I still learned something putting it together, so not a total loss 😀! |
|
Closing as not required given the other editor functionality available 😀 |
PR Summary
Expose a setting
removeTrailingWhitespace(defaults tofalse) related to the PSSA ruleAvoidTrailingWhitespace- which since the release of 1.24 can correctly fix trailing whitespace throughInvoke-Formatter.Requires PSES PR first: PowerShell/PowerShellEditorServices#2258
PR Checklist
Note: Tick the boxes below that apply to this pull request by putting an
xbetween the square brackets.Please mark anything not applicable to this PR
NA.WIP:to the beginning of the title and remove the prefix when the PR is ready